package cn.cdiothree.service;

import cn.cdiothree.DTO.OrderDTO;
import cn.cdiothree.dataobject.ProductOrder;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
//import org.springframework.data.domain.Page;
//import org.springframework.data.domain.Pageable;

import java.awt.print.Pageable;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author CumThing
 * @since 2020-02-02
 */
public interface ProductOrderService extends IService<ProductOrder>{

    /**
     * 创建订单
     * @param orderDTO
     * @return
     */
    OrderDTO create(OrderDTO orderDTO);

    /**
     * 根据订单id查询订单详情
     * @param orderId
     * @return
     */
    OrderDTO findOne(String orderId);

    /**
     * 根据用户id查询订单列表
     * @param num
     * @param size
     * @param userId
     * @return
     */
    PageInfo<OrderDTO> findList(int num,int size,Integer userId);

    /**
     * 取消订单
     * @param orderDTO
     * @return
     */
    OrderDTO cancel(OrderDTO orderDTO);

    /**
     * 完结订单
     * @param orderDTO
     * @return
     */
    OrderDTO finish(OrderDTO orderDTO);

    /**
     * 修改订单支付状态
     * @param orderDTO
     * @return
     */
    OrderDTO paid(OrderDTO orderDTO);

    /**
     * 卖家端查询订单
     * @param num
     * @param size
     * @return
     */
    PageInfo<OrderDTO> findList(int num,int size);
}
